package org.hubwork.base.common;

import java.util.List;

import org.springframework.stereotype.Repository;

@Repository
public class HubT2DAOImplMyBatis implements HubT2DAO{

	@Override
	public void save(HubT2 t2) throws Exception {
		
		ContextSupport.setCurrentSqlSessionFactoryKey("B_HUB2");
		HubApplicationContext.get(DynamicSqlSessionDaoSupport.class).getSqlSession().insert("T2.save", t2);
	}
	
	@SuppressWarnings("unchecked")
	public List<HubT2> find() throws Exception {
		ContextSupport.setCurrentSqlSessionFactoryKey("B_HUB2");
		return HubApplicationContext.get(DynamicSqlSessionDaoSupport.class).getSqlSession().selectList("T2.findAll");		
	} 

}
